﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:SilverlightInEnterprise.VisualStateManagerDemo" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">


    <Style TargetType="local:CustomControl1">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:CustomControl1">
                	<Canvas x:Name="bob" Background="{TemplateBinding Background}" Width="300">
                		<Canvas.Resources>
                			<Storyboard x:Name="AppExit">
                				<DoubleAnimation Duration="0:0:0.6" To="5" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                				<DoubleAnimation Duration="0:0:0.6" To="5" Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                				<DoubleAnimation Duration="0:0:0.6" To="-2" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                			</Storyboard>
                		</Canvas.Resources>
                		<VisualStateManager.VisualStateGroups>
                			<VisualStateGroup x:Name="TestGroup">
                				<VisualStateGroup.Transitions>
                					<VisualTransition GeneratedDuration="0:0:1"/>
                				</VisualStateGroup.Transitions>
                				<VisualState x:Name="State1"/>
                				<VisualState x:Name="State2">
                					<Storyboard>
                						<DoubleAnimation Duration="0" To="67" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                						<DoubleAnimation Duration="0" To="2" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                					</Storyboard>
                				</VisualState>
                			</VisualStateGroup>
                		</VisualStateManager.VisualStateGroups>
                		<Ellipse x:Name="ellipse" Canvas.Left="-1" Margin="0" d:LayoutOverrides="VerticalMargin" RenderTransformOrigin="0.5,0.5" Width="100" Height="100">
                			<Ellipse.RenderTransform>
                				<CompositeTransform/>
                			</Ellipse.RenderTransform>
                			<Ellipse.Fill>
                				<LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
                					<GradientStop Color="#FFFFFFFF" Offset="0"/>
                					<GradientStop Color="#F9FFFFFF" Offset="0.375"/>
                					<GradientStop Color="#E5FFFFFF" Offset="0.625"/>
                					<GradientStop Color="{StaticResource CircleColor}" Offset="1"/>
                				</LinearGradientBrush>
                			</Ellipse.Fill>
                		</Ellipse>
                	</Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
